<?php

  require_once 'JooS/Browser/Abstract.php';

  class JooS_Browser_Safari extends JooS_Browser_Abstract{
    protected function getName() {
      return "Safari";
    }

    protected function getVersion() {
      $ver = null;

      $ua = $this->getUA();

      if (preg_match_all("/AppleWebKit\/(\d+(\.\d+(\.\d+)?)?)/", $ua, $match)) {
        $wk = $match[1][0];
        if (version_compare("522.11", $wk, ">")) {
          $this->throwException($ver);
        }
        elseif (version_compare("525.13", $wk, ">")) {
          $ver = "3.0";
        }
        elseif (version_compare("526.9", $wk, ">")) {
          $ver = "3.1";
        }
        else {
          $ver = "4.0";
        }
      }
      return $ver;
    }
  }

?>